package com.demo.reflect.po;

/**
 * @description:
 * @className: Student
 * @package: com.demo.first.reflect.po
 * @author: dongww@hsyuntai.com
 * @date: 2019/4/3 11:38
 * @copyright: 版权归 HSYUNTAI 所有
 */
public class Student {

    public char name;
    public int age;
    public float height;
    public boolean sex;
    private String address;

    Student(String string) {
        System.out.println("调用了一个默认构造方法--string：" + string);
    }

    public Student() {
       System.out.println("调用了无参构造方法");
    }

    public Student(char name) {
        System.out.println("调用了一个参数构造方法--姓名：" + name);
    }

    public Student(String name, int age) {
        System.out.println("调用了多个参数构造方法--姓名：" + name + "-年龄：" + age);
    }

    protected Student(float height) {
        System.out.println("调用了受保护构造方法--身高：" + height);
    }

    private Student(boolean sex) {
        System.out.println("调用了私有构造方法--boy：" + sex);
    }

    @Override
    public String toString() {
        return "Student [name=" + name
                + ", age=" + age
                + ", height=" + height
                + ", sex=" + sex
                + ", address=" + address+ "]";
    }

    void show1(){
        System.out.println("调用了默认的，无参的show3()");
    }
    public void show2(float height,int age){
        System.out.println("调用了公有的，float参数的show1(): height = " + height + "-年龄=" + age);
    }
    protected void show3(){
        System.out.println("调用了受保护的，无参的show2()");
    }
    private void show4(int age){
        System.out.println("调用了私有的，并且有返回值的，int参数的show4(): age = " + age);
    }

}
